//
//  SYKaoQinYiChangTableViewCell.m
//  SanYiTeaching
//
//  Created by 郑浩然 on 2019/6/13.
//  Copyright © 2019年 SanYi. All rights reserved.
//

#import "SYKaoQinYiChangTableViewCell.h"
#import "SYKaoQinYiChangDetailsView.h"


@interface SYKaoQinYiChangTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *xingmingLab;
@property (weak, nonatomic) IBOutlet UILabel *xuehaoLab;
@property (weak, nonatomic) IBOutlet UILabel *shangkeNumberLab;
@property (weak, nonatomic) IBOutlet UILabel *yichangNumberLab;
@property (weak, nonatomic) IBOutlet UILabel *kaishiLab;
@property (weak, nonatomic) IBOutlet UILabel *jieshuLab;
@property (strong, nonatomic) SYKaoQinYiChangDetailsView *detailsView;

@end


@implementation SYKaoQinYiChangTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setKqycModel:(SYKaoQinYiChangModel *)kqycModel {
    _kqycModel = kqycModel;
    self.xingmingLab.text = kqycModel.StudentName;
    self.xuehaoLab.text = kqycModel.Serial;
    self.shangkeNumberLab.text = kqycModel.LessonTimes;
    self.yichangNumberLab.text = kqycModel.ErrorCount;
    self.kaishiLab.text = kqycModel.CreateDate;
    self.jieshuLab.text = kqycModel.EndDate;
}

- (IBAction)mingxiBtnClick:(UIButton *)sender {
    [MBProgressHUD mj_showLoading];
    __weak typeof(self) weakSelf = self;
    [SYRequestAPI sy_getGetAttendanceStudentDetailInfoClassId:_kqycModel.ClassId sutdentId:_kqycModel.StudentId totalLessonTimes:_kqycModel.TotalLessonTimes success:^(NSMutableArray *dataListArr) {
        [MBProgressHUD mj_hideHUD];
        [weakSelf mingxiDetailsViewDataListArr:dataListArr];
    } fail:^(NSError *error) {
        [MBProgressHUD mj_hideHUD];
    }];
}
- (IBAction)lianxijiazhangBtnClick:(UIButton *)sender {
    NSMutableString* str=[[NSMutableString alloc] initWithFormat:@"tel:%@",_kqycModel.Linker];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
//跳出来明细详情
- (void)mingxiDetailsViewDataListArr:(NSMutableArray *)dataListArr {
    _detailsView = [[NSBundle mainBundle] loadNibNamed:@"SYKaoQinYiChangDetailsView" owner:nil options:nil].firstObject;
    [_detailsView showDetailsView:_detailsView dataListArr:dataListArr];
    
    
}

@end






























